package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.promotebean.Topic;
import com.cskaoyan.service.promoteservice.TopicService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.wx.WxTopicDetailVo;
import com.cskaoyan.vo.wx.WxTopicListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: feisl
 * @Date: 2021/5/13 15:16
 */
@RestController
@RequestMapping("wx/topic")
public class WxTopicController {

    @Autowired
    TopicService topicService;
    @RequestMapping("list")
    public BaseRespVo list(Integer page,Integer size){

        WxTopicListVo wxTopicListVo = topicService.list(page,size);

        return BaseRespVo.ok(wxTopicListVo);
    }
    @RequestMapping("detail")
    public BaseRespVo detail(Integer id){

        WxTopicDetailVo wxTopicDetailVo = topicService.detail(id);

        return BaseRespVo.ok(wxTopicDetailVo);
    }

    @RequestMapping("related")
    public BaseRespVo related(){

       List<Topic> list = topicService.related();

       return BaseRespVo.ok(list);
    }
}
